//
//  JRTXDiagramDataToCoordsConverter.h
//  
//
//  Created by JIRENTIANXIANG on 6/21/15.
//
//

#import <Foundation/Foundation.h>
#import <QuartzCore/QuartzCore.h>

@class JRTXDiagramView;
@class JRTXDiagramDatum;
@class JRTXDiagramPoint;

@interface JRTXDiagramDataDisplayMapper : NSObject

@property (strong,readonly,nonatomic) NSArray* points;

@property (readonly,nonatomic) float xSpan;
@property (readonly,nonatomic) float ySpan;
@property (readonly,nonatomic) float minX;
@property (readonly,nonatomic) float maxX;
@property (readonly,nonatomic) float minY;
@property (readonly,nonatomic) float maxY;

+(instancetype)mapperForDiagramView:(JRTXDiagramView*)diagramView;

-(void)update;

-(CGFloat)xCoordFromValue:(NSNumber*)value;
-(CGFloat)yCoordFromValue:(NSNumber*)value;
-(JRTXDiagramPoint*)pointFromDatum:(JRTXDiagramDatum*)datum;

@end
